import type { GeneratedEtsLibFile } from "../../types/generated";

export const FILE: GeneratedEtsLibFile = {
  path: 'ets/api/@ohos.net.socket.d.ts',
  content: "/*\n * Copyright (c) 2021-2023 Huawei Device Co., Ltd.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @file\n * @kit NetworkKit\n */\nimport type { AsyncCallback, Callback, ErrorCallback } from './@ohos.base';\nimport connection from \"./@ohos.net.connection\";\nimport type cert from './@ohos.security.cert';\n/**\n * Provides TCP and UDP Socket APIs.\n * @namespace socket\n * @syscap SystemCapability.Communication.NetStack\n * @since 7\n */\n/**\n * Provides TCP and UDP Socket APIs.\n * @namespace socket\n * @syscap SystemCapability.Communication.NetStack\n * @crossplatform\n * @since 10\n */\ndeclare namespace socket {\n    export import NetAddress = connection.NetAddress;\n    /**\n     * Deposit certificate\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Deposit certificate\n     * @typedef { cert.EncodingBlob }\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export type X509CertRawData = cert.EncodingBlob;\n    /**\n     * Creates a UDPSocket object.\n     * @returns { UDPSocket } the UDPSocket of the constructUDPSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Creates a UDPSocket object.\n     * @returns { UDPSocket } the UDPSocket of the constructUDPSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    function constructUDPSocketInstance(): UDPSocket;\n    /**\n     * Creates a MulticastSocket object.\n     * @returns { MulticastSocket } the MulticastSocket of the constructMulticastSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Creates a MulticastSocket object.\n     * @returns { MulticastSocket } the MulticastSocket of the constructMulticastSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    function constructMulticastSocketInstance(): MulticastSocket;\n    /**\n     * Creates a TCPSocket object.\n     * @returns { TCPSocket } the TCPSocket of the constructTCPSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Creates a TCPSocket object.\n     * @returns { TCPSocket } the TCPSocket of the constructTCPSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    function constructTCPSocketInstance(): TCPSocket;\n    /**\n     * Creates a TLSSocket object.\n     * @returns { TLSSocket } the TLSSocket of the constructTLSSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Creates a TLSSocket object.\n     * @returns { TLSSocket } the TLSSocket of the constructTLSSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    function constructTLSSocketInstance(): TLSSocket;\n    /**\n     * Creates a TLSSocket object with a TCPSocket object.\n     * @param { TCPSocket } tcpSocket - Parameter for creating a TLSSocket object.\n     * @returns { TLSSocket } the TLSSocket of the constructTLSSocketInstance.\n     * @throws { BusinessError } 401 - Parameter error.\n     * @throws { BusinessError } 2300002 - System internal error.\n     * @throws { BusinessError } 2303601 - Invalid socket FD.\n     * @throws { BusinessError } 2303602 - Socket is not connected.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 12\n     */\n    function constructTLSSocketInstance(tcpSocket: TCPSocket): TLSSocket;\n    /**\n     * Creates a TCPSocketServer object.\n     * @returns { TCPSocketServer } the TCPSocketServer of the constructTCPSocketServerInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    function constructTCPSocketServerInstance(): TCPSocketServer;\n    /**\n     * Creates a TLSSocketServer object.\n     * @returns { TLSSocketServer } the TLSSocketServer of the constructTLSSocketServerInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    function constructTLSSocketServerInstance(): TLSSocketServer;\n    /**\n     * Creates a LocalSocket object.\n     * @returns { LocalSocket } the LocalSocket of the constructLocalSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Creates a LocalSocket object.\n     * @returns { LocalSocket } the LocalSocket of the constructLocalSocketInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    function constructLocalSocketInstance(): LocalSocket;\n    /**\n     * Creates a LocalSocketServer object.\n     * @returns { LocalSocketServer } the LocalSocketServer of the constructLocalSocketServerInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Creates a LocalSocketServer object.\n     * @returns { LocalSocketServer } the LocalSocketServer of the constructLocalSocketServerInstance.\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    function constructLocalSocketServerInstance(): LocalSocketServer;\n    /**\n     * Defines the parameters for sending data over the UDPSocket connection.\n     * @interface UDPSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines the parameters for sending data over the UDPSocket connection.\n     * @interface UDPSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface UDPSendOptions {\n        /**\n         * Data to send.\n         * @type {string | ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Data to send.\n         * @type {string | ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        data: string | ArrayBuffer;\n        /**\n         * Destination address.\n         * @type {NetAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Destination address.\n         * @type {NetAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        address: NetAddress;\n        /**\n         * Set this option for the proxy feature.\n         * @type {?ProxyOptions}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        proxy?: ProxyOptions;\n    }\n    /**\n     * Specify proxy types.\n     * @enum {number}\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 18\n     */\n    export enum ProxyTypes {\n        /**\n         * No proxy.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        NONE = 0,\n        /**\n         * Use Socks5 proxy.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        SOCKS5 = 1\n    }\n    /**\n     * Define parameters for the proxy connection.\n     * @interface ProxyOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 18\n     */\n    export interface ProxyOptions {\n        /**\n         * Proxy types.\n         * @type {ProxyTypes}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        type: ProxyTypes;\n        /**\n         * Proxy server address.\n         * @type {NetAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        address: NetAddress;\n        /**\n         * Specify username, if the proxy server supports user-password authentication.\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        username?: string;\n        /**\n         * Specify password, if the proxy server supports user-password authentication.\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        password?: string;\n    }\n    /**\n     * @interface ExtraOptionsBase\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * @interface ExtraOptionsBase\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface ExtraOptionsBase {\n        /**\n         * Size of the receive buffer, in MBS.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Size of the receive buffer, in MBS.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        receiveBufferSize?: number;\n        /**\n         * Size of the send buffer, in MBS.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Size of the send buffer, in MBS.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        sendBufferSize?: number;\n        /**\n         * Whether to reuse addresses. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether to reuse addresses. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        reuseAddress?: boolean;\n        /**\n         * Timeout duration of the UDPSocket connection, in milliseconds.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Timeout duration of the UDPSocket connection, in milliseconds.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        socketTimeout?: number;\n    }\n    /**\n     * Defines other properties of the UDPSocket connection.\n     * @interface UDPExtraOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines other properties of the UDPSocket connection.\n     * @extends ExtraOptionsBase\n     * @interface UDPExtraOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface UDPExtraOptions extends ExtraOptionsBase {\n        /**\n         * Whether to send broadcast messages. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether to send broadcast messages. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        broadcast?: boolean;\n    }\n    /**\n     * Defines the status of the socket connection.\n     * @interface SocketStateBase\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines the status of the socket connection.\n     * @interface SocketStateBase\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface SocketStateBase {\n        /**\n         * Whether the connection is in the bound state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether the connection is in the bound state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        isBound: boolean;\n        /**\n         * Whether the connection is in the closed state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether the connection is in the closed state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        isClose: boolean;\n        /**\n         * Whether the connection is in the connected state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether the connection is in the connected state.\n         * @type {boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        isConnected: boolean;\n    }\n    /**\n     * Defines information about the socket connection.\n     * @interface SocketRemoteInfo\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines information about the socket connection.\n     * @interface SocketRemoteInfo\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface SocketRemoteInfo {\n        /**\n         * Bound IP address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Bound IP address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        address: string;\n        /**\n         * Network protocol type. The options are as follows: IPv4, IPv6.\n         * @type {'IPv4' | 'IPv6'}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Network protocol type. The options are as follows: IPv4, IPv6.\n         * @type {'IPv4' | 'IPv6'}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        family: 'IPv4' | 'IPv6';\n        /**\n         * Port number. The value ranges from 0 to 65535.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Port number. The value ranges from 0 to 65535.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        port: number;\n        /**\n         * Length of the server response message, in bytes.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Length of the server response message, in bytes.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        size: number;\n    }\n    /**\n     * Defines the local socket connection information.\n     * @interface LocalSocketMessageInfo\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines the local socket connection information.\n     * @interface LocalSocketMessageInfo\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalSocketMessageInfo {\n        /**\n         * Message data.\n         * @type {ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Message data.\n         * @type {ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        message: ArrayBuffer;\n        /**\n         * Bound local socket address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Bound local socket address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        address: string;\n        /**\n         * Length of the message, in bytes.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Length of the message, in bytes.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        size: number;\n    }\n    /**\n     * Defines a local address.\n     * @interface LocalAddress\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines a local address.\n     * @interface LocalAddress\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalAddress {\n        /**\n         * LocalAddress address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * LocalAddress address.\n         * @type {string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        address: string;\n    }\n    /**\n     * Defines LocalSocket connection parameters.\n     * @interface LocalConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines LocalSocket connection parameters.\n     * @interface LocalConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalConnectOptions {\n        /**\n         * Bound Local address.\n         * @type {LocalAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Bound Local address.\n         * @type {LocalAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        address: LocalAddress;\n        /**\n         * Timeout duration of the LocalSocket connection, in milliseconds.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Timeout duration of the LocalSocket connection, in milliseconds.\n         * @type {?number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        timeout?: number;\n    }\n    /**\n     * Defines the parameters for sending data over the LocalSocket connection.\n     * @interface LocalSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines the parameters for sending data over the LocalSocket connection.\n     * @interface LocalSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalSendOptions {\n        /**\n         * Data to send.\n         * @type {string | ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Data to send.\n         * @type {string | ArrayBuffer}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        data: string | ArrayBuffer;\n        /**\n         * Character encoding format.\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Character encoding format.\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        encoding?: string;\n    }\n    /**\n     * Defines a UDPSocket connection.\n     * @interface UDPSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines a UDPSocket connection.\n     * @interface UDPSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface UDPSocket {\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress): Promise<void>;\n        /**\n         * Obtains the local address of a UDPSocket connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        send(options: UDPSendOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sends data over a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPSendOptions } options - Optional parameters {@link UDPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        send(options: UDPSendOptions): Promise<void>;\n        /**\n         * Closes a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Closes a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(callback: AsyncCallback<void>): void;\n        /**\n         * Closes a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Closes a UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the status of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the status of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(callback: AsyncCallback<SocketStateBase>): void;\n        /**\n         * Obtains the status of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the status of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Sets other attributes of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.\n         * @param { AsyncCallback<void> }callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets other attributes of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.\n         * @param { AsyncCallback<void> }callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets other attributes of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets other attributes of the UDPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { UDPExtraOptions } options - Optional parameters {@link UDPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: UDPExtraOptions): Promise<void>;\n        /**\n         * Listens for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Listens for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        on(type: 'message', callback: Callback<SocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Cancels listening for message receiving events of the UDPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        off(type: 'message', callback?: Callback<SocketMessageInfo>): void;\n        /**\n         * Listens for data packet message events or close events of the UDPSocket connection.\n         * @param { 'listening' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for data packet message events or close events of the UDPSocket connection.\n         * @param { 'listening' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'listening' | 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for data packet message events or close events of the UDPSocket connection.\n         * @param { 'listening' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for data packet message events or close events of the UDPSocket connection.\n         * @param { 'listening' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'listening' | 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the UDPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for error events of the UDPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the UDPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for error events of the UDPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines a UDP MulticastSocket connection.\n     * @interface MulticastSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines a UDP MulticastSocket connection.\n     * @extends UDPSocket\n     * @interface MulticastSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface MulticastSocket extends UDPSocket {\n        /**\n         * Add the socket to the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @param { AsyncCallback<void> } callback - The callback of addMembership.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Add the socket to the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @param { AsyncCallback<void> } callback - The callback of addMembership.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        addMembership(multicastAddress: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Add the socket to the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Add the socket to the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        addMembership(multicastAddress: NetAddress): Promise<void>;\n        /**\n         * Drop the socket from the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @param { AsyncCallback<void> } callback - The callback of dropMembership.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Drop the socket from the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @param { AsyncCallback<void> } callback - The callback of dropMembership.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        dropMembership(multicastAddress: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Drop the socket from the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Drop the socket from the multicast group.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } multicastAddress - Multicast address information. {@link NetAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @throws { BusinessError } 2301098 - Address in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        dropMembership(multicastAddress: NetAddress): Promise<void>;\n        /**\n         * Set the TTL value for socket multicast packets.\n         * @param { number } ttl - The TTL value to set. Valid range is typically 0 to 255.\n         * @param { AsyncCallback<void> } callback - The callback of setMulticastTTL.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Set the TTL value for socket multicast packets.\n         * @param { number } ttl - The TTL value to set. Valid range is typically 0 to 255.\n         * @param { AsyncCallback<void> } callback - The callback of setMulticastTTL.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setMulticastTTL(ttl: number, callback: AsyncCallback<void>): void;\n        /**\n         * Set the TTL value for socket multicast packet.\n         * @param { number } ttl - The TTL value to set. Valid range is typically 0 to 255.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Set the TTL value for socket multicast packet.\n         * @param { number } ttl - The TTL value to set. Valid range is typically 0 to 255.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setMulticastTTL(ttl: number): Promise<void>;\n        /**\n         * Get the TTL value of socket multicast packet.\n         * @param { AsyncCallback<number> } callback - The callback of getMulticastTTL.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Get the TTL value of socket multicast packet.\n         * @param { AsyncCallback<number> } callback - The callback of getMulticastTTL.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getMulticastTTL(callback: AsyncCallback<number>): void;\n        /**\n         * Get the TTL value of socket multicast packet.\n         * @returns { Promise<number> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Get the TTL value of socket multicast packet.\n         * @returns { Promise<number> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getMulticastTTL(): Promise<number>;\n        /**\n         * Set the loopback mode for the socket.\n         * @param { boolean } flag - Whether to enable loopback mode.\n         * @param { AsyncCallback<void> } callback - The callback of setLoopbackMode.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Set the loopback mode for the socket.\n         * @param { boolean } flag - Whether to enable loopback mode.\n         * @param { AsyncCallback<void> } callback - The callback of setLoopbackMode.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setLoopbackMode(flag: boolean, callback: AsyncCallback<void>): void;\n        /**\n         * Set the loopback mode for the socket.\n         * @param { boolean } flag - Whether to enable loopback mode.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Set the loopback mode for the socket.\n         * @param { boolean } flag - Whether to enable loopback mode.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setLoopbackMode(flag: boolean): Promise<void>;\n        /**\n         * Get the loopback mode of the socket.\n         * @param { AsyncCallback<boolean> } callback - The callback of getLoopbackMode.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Get the loopback mode of the socket.\n         * @param { AsyncCallback<boolean> } callback - The callback of getLoopbackMode.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getLoopbackMode(callback: AsyncCallback<boolean>): void;\n        /**\n         * Get the loopback mode of the socket.\n         * @returns { Promise<boolean> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Get the loopback mode of the socket.\n         * @returns { Promise<boolean> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301088 - Not a socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getLoopbackMode(): Promise<boolean>;\n    }\n    /**\n     * Defines a LocalSocket connection.\n     * @interface LocalSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines a LocalSocket connection.\n     * @interface LocalSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalSocket {\n        /**\n         * Binds the Local address.\n         * @param { LocalAddress } address - Destination address. {@link LocalAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301098 - Address already in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Binds the Local address.\n         * @param { LocalAddress } address - Destination address. {@link LocalAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301098 - Address already in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        bind(address: LocalAddress): Promise<void>;\n        /**\n         * Sets up a connection to the specified Local address .\n         * @param { LocalConnectOptions } options - Optional parameters {@link LocalConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301111 - Connection refused.\n         * @throws { BusinessError } 2301099 - Cannot assign requested address.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Sets up a connection to the specified Local address .\n         * @param { LocalConnectOptions } options - Optional parameters {@link LocalConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301111 - Connection refused.\n         * @throws { BusinessError } 2301099 - Cannot assign requested address.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        connect(options: LocalConnectOptions): Promise<void>;\n        /**\n         * Sends data over a LocalSocket connection.\n         * @param { LocalSendOptions } options - Optional parameters {@link LocalSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301011 - Operation would block.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Sends data over a LocalSocket connection.\n         * @param { LocalSendOptions } options - Optional parameters {@link LocalSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301011 - Operation would block.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        send(options: LocalSendOptions): Promise<void>;\n        /**\n         * Closes a LocalSocket connection.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Closes a LocalSocket connection.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the status of the LocalSocket connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Obtains the status of the LocalSocket connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Obtains the file descriptor of the LocalSocket connection.\n         * @returns { Promise<number> } The promise returns the file descriptor of the LocalSocket connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Obtains the file descriptor of the LocalSocket connection.\n         * @returns { Promise<number> } The promise returns the file descriptor of the LocalSocket connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getSocketFd(): Promise<number>;\n        /**\n         * Sets other attributes of the LocalSocket connection.\n         * @param { ExtraOptionsBase } options - Optional parameters {@link ExtraOptionsBase}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Sets other attributes of the LocalSocket connection.\n         * @param { ExtraOptionsBase } options - Optional parameters {@link ExtraOptionsBase}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setExtraOptions(options: ExtraOptionsBase): Promise<void>;\n        /**\n         * Gets other attributes of the LocalSocket connection.\n         * @returns { Promise<ExtraOptionsBase> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Gets other attributes of the LocalSocket connection.\n         * @returns { Promise<ExtraOptionsBase> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getExtraOptions(): Promise<ExtraOptionsBase>;\n        /**\n         * Obtains the local address of a LocalSocket connection.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<string>;\n        /**\n         * Listens for message receiving events of the LocalSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for message receiving events of the LocalSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'message', callback: Callback<LocalSocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the LocalSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for message receiving events of the LocalSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'message', callback?: Callback<LocalSocketMessageInfo>): void;\n        /**\n         * Listens for connection events of the LocalSocket connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for connection events of the LocalSocket connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'connect', callback: Callback<void>): void;\n        /**\n         * Cancels listening for connection events of the LocalSocket connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for connection events of the LocalSocket connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'connect', callback?: Callback<void>): void;\n        /**\n         * Listens for close events of the LocalSocket connection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for close events of the LocalSocket connection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for close events of the LocalSocket connection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for close events of the LocalSocket connection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the LocalSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for error events of the LocalSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the LocalSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for error events of the LocalSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines the connection of the LocalSocket client and server.\n     * @interface LocalSocketConnection\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines the connection of the LocalSocket client and server.\n     * @interface LocalSocketConnection\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalSocketConnection {\n        /**\n         * The id of a client connects to the LocalSocketServer.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * The id of a client connects to the LocalSocketServer.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        clientId: number;\n        /**\n         * Sends data over a LocalSocketServer connection to client.\n         * @param { LocalSendOptions } options - Parameters for sending data {@link LocalSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301011 - Operation would block.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Sends data over a LocalSocketServer connection to client.\n         * @param { LocalSendOptions } options - Parameters for sending data {@link LocalSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301011 - Operation would block.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        send(options: LocalSendOptions): Promise<void>;\n        /**\n         * Closes a LocalSocket client connection.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Closes a LocalSocket client connection.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the local address of a LocalSocket client connection.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<string>;\n        /**\n         * Listens for message receiving events of the LocalSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for message receiving events of the LocalSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'message', callback: Callback<LocalSocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the LocalSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for message receiving events of the LocalSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<LocalSocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'message', callback?: Callback<LocalSocketMessageInfo>): void;\n        /**\n         * Listens for close events of the LocalSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for close events of the LocalSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for close events of the LocalSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for close events of the LocalSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the LocalSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for error events of the LocalSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the LocalSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for error events of the LocalSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines a LocalSocket server connection.\n     * @interface LocalSocketServer\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 11\n     */\n    /**\n     * Defines a LocalSocket server connection.\n     * @interface LocalSocketServer\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 12\n     */\n    export interface LocalSocketServer {\n        /**\n         * Binds the Local address.\n         * <p>Listens for a LocalSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @param { LocalAddress } address - Network address information {@link LocalAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301098 - Address already in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Binds the Local address.\n         * <p>Listens for a LocalSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @param { LocalAddress } address - Network address information {@link LocalAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2301013 - Insufficient permissions.\n         * @throws { BusinessError } 2301022 - Invalid argument.\n         * @throws { BusinessError } 2301098 - Address already in use.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        listen(address: LocalAddress): Promise<void>;\n        /**\n         * Obtains the status of the LocalSocketServer connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Obtains the status of the LocalSocketServer connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Sets other attributes of the LocalSocketServer connection.\n         * @param { ExtraOptionsBase } options - Parameters of the attributes {@link ExtraOptionsBase}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Sets other attributes of the LocalSocketServer connection.\n         * @param { ExtraOptionsBase } options - Parameters of the attributes {@link ExtraOptionsBase}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        setExtraOptions(options: ExtraOptionsBase): Promise<void>;\n        /**\n         * Gets other attributes of the LocalSocket connection.\n         * @returns { Promise<ExtraOptionsBase> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Gets other attributes of the LocalSocket connection.\n         * @returns { Promise<ExtraOptionsBase> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        getExtraOptions(): Promise<ExtraOptionsBase>;\n        /**\n         * Obtains the local address of the LocalSocketServer connection.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<string>;\n        /**\n         * Listens for connect events of the LocalSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<LocalSocketConnection> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for connect events of the LocalSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<LocalSocketConnection> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'connect', callback: Callback<LocalSocketConnection>): void;\n        /**\n         * Cancels listening for connect events of the LocalSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<LocalSocketConnection> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for connect events of the LocalSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<LocalSocketConnection> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'connect', callback?: Callback<LocalSocketConnection>): void;\n        /**\n         * Listens for error events of the LocalSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for error events of the LocalSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the LocalSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for error events of the LocalSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines TCPSocket connection parameters.\n     * @interface TCPConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines TCPSocket connection parameters.\n     * @interface TCPConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TCPConnectOptions {\n        /**\n         * Bound IP address and port number.\n         * @type { NetAddress }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Bound IP address and port number.\n         * @type { NetAddress }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        address: NetAddress;\n        /**\n         * Timeout duration of the TCPSocket connection, in milliseconds.\n         * @type { ?number }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Timeout duration of the TCPSocket connection, in milliseconds.\n         * @type { ?number }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        timeout?: number;\n        /**\n         * Set this option for the proxy feature.\n         * @type {?ProxyOptions}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        proxy?: ProxyOptions;\n    }\n    /**\n     * Defines the parameters for sending data over the TCPSocket connection.\n     * @interface TCPSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines the parameters for sending data over the TCPSocket connection.\n     * @interface TCPSendOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TCPSendOptions {\n        /**\n         * Data to send.\n         * @type { string | ArrayBuffer }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Data to send.\n         * @type { string | ArrayBuffer }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        data: string | ArrayBuffer;\n        /**\n         * Character encoding format.\n         * @type { ?string }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Character encoding format.\n         * @type { ?string }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        encoding?: string;\n    }\n    /**\n     * Defines other properties of the TCPSocket connection.\n     * @interface TCPExtraOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines other properties of the TCPSocket connection.\n     * @extends ExtraOptionsBase\n     * @interface TCPExtraOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TCPExtraOptions extends ExtraOptionsBase {\n        /**\n         * Whether to keep the connection alive. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether to keep the connection alive. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        keepAlive?: boolean;\n        /**\n         * Whether to enable OOBInline. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether to enable OOBInline. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        OOBInline?: boolean;\n        /**\n         * Whether to enable no-delay on the TCPSocket connection. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Whether to enable no-delay on the TCPSocket connection. The default value is false.\n         * @type { ?boolean }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        TCPNoDelay?: boolean;\n        /**\n         * Socket linger.\n         * @type { ?object }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 7\n         */\n        /**\n         * Socket linger.\n         * @type { ?object }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        socketLinger?: {\n            on: boolean;\n            linger: number;\n        };\n    }\n    /**\n     * Defines a TCPSocket connection.\n     * @interface TCPSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 7\n     */\n    /**\n     * Defines a TCPSocket connection.\n     * @interface TCPSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TCPSocket {\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - Return the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress): Promise<void>;\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        connect(options: TCPConnectOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPConnectOptions } options - Optional parameters {@link TCPConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        connect(options: TCPConnectOptions): Promise<void>;\n        /**\n         * Sends data over a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sends data over a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        send(options: TCPSendOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sends data over a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sends data over a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Optional parameters {@link TCPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        send(options: TCPSendOptions): Promise<void>;\n        /**\n         * Closes a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Closes a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(callback: AsyncCallback<void>): void;\n        /**\n         * Closes a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Closes a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the peer address of a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress. {@link NetAddress}\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the peer address of a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress. {@link NetAddress}\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteAddress(callback: AsyncCallback<NetAddress>): void;\n        /**\n         * Obtains the peer address of a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the peer address of a TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteAddress(): Promise<NetAddress>;\n        /**\n         * Obtains the status of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the status of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState. {@link SocketStateBase}\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(callback: AsyncCallback<SocketStateBase>): void;\n        /**\n         * Obtains the status of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Obtains the status of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Obtains the file descriptor of the TCPSocket connection.\n         * @param { AsyncCallback<number> } callback - The callback returns the file descriptor of the TCPSocket connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getSocketFd(callback: AsyncCallback<number>): void;\n        /**\n         * Obtains the file descriptor of the TCPSocket connection.\n         * @returns { Promise<number> } The promise returns the file descriptor of the TCPSocket connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getSocketFd(): Promise<number>;\n        /**\n         * Sets other attributes of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets other attributes of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets other attributes of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Sets other attributes of the TCPSocket connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions): Promise<void>;\n        /**\n         * Obtains the local address of a TCPSocket connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Listens for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        on(type: 'message', callback: Callback<SocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Cancels listening for message receiving events of the TCPSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        off(type: 'message', callback?: Callback<SocketMessageInfo>): void;\n        /**\n         * Listens for connection or close events of the TCPSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for connection or close events of the TCPSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'connect' | 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for connection or close events of the TCPSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for connection or close events of the TCPSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'connect' | 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the TCPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Listens for error events of the TCPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TCPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 7\n         */\n        /**\n         * Cancels listening for error events of the TCPSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines a TLSSocket connection.\n     * @interface TLSSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Defines a TLSSocket connection.\n     * @interface TLSSocket\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TLSSocket {\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @param { AsyncCallback<void> } callback - the callback of bind.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Binds the IP address and port number. The port number can be specified or randomly allocated by the system.\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Destination address. {@link NetAddress}\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        bind(address: NetAddress): Promise<void>;\n        /**\n         * Obtains the peer address of a TLSSocket connection.\n         * @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Obtains the peer address of a TLSSocket connection.\n         * @param { AsyncCallback<NetAddress> } callback - the callback of getRemoteAddress.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteAddress(callback: AsyncCallback<NetAddress>): void;\n        /**\n         * Obtains the peer address of a TLSSocket connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Obtains the peer address of a TLSSocket connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteAddress(): Promise<NetAddress>;\n        /**\n         * Obtains the status of the TLSSocket connection.\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Obtains the status of the TLSSocket connection.\n         * @param { AsyncCallback<SocketStateBase> } callback - the callback of getState.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(callback: AsyncCallback<SocketStateBase>): void;\n        /**\n         * Obtains the status of the TLSSocket connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Obtains the status of the TLSSocket connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Sets other attributes of the TLSSocket connection.\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sets other attributes of the TLSSocket connection.\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets other attributes of the TLSSocket connection.\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sets other attributes of the TLSSocket connection.\n         * @param { TCPExtraOptions } options - Optional parameters {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions): Promise<void>;\n        /**\n         * Obtains the local address of a TLSSocket connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Listens for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Listens for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        on(type: 'message', callback: Callback<SocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Cancels listening for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Cancels listening for message receiving events of the TLSSocket connection.\n         * @param { 'message' } type Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        off(type: 'message', callback?: Callback<SocketMessageInfo>): void;\n        /**\n         * Listens for connection or close events of the TLSSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param {Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Listens for connection or close events of the TLSSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param {Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'connect' | 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for connection or close events of the TLSSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param {Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Cancels listening for connection or close events of the TLSSocket connection.\n         * @param { 'connect' | 'close' } type - Indicates Event name.\n         * @param {Callback<void> } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'connect' | 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the TLSSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Listens for error events of the TLSSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TLSSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Cancels listening for error events of the TLSSocket connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - the callback used to return the result.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n        /**\n         * Returns an object representing a local certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - the callback of getCertificate.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns an object representing a local certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - the callback of getCertificate.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getCertificate(callback: AsyncCallback<X509CertRawData>): void;\n        /**\n         * Returns an object representing a local certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns an object representing a local certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getCertificate(): Promise<X509CertRawData>;\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * <p>an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - the callback of getRemoteCertificate.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * <p>an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - the callback of getRemoteCertificate.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteCertificate(callback: AsyncCallback<X509CertRawData>): void;\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * <p>an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * <p>an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getRemoteCertificate(): Promise<X509CertRawData>;\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @param { AsyncCallback<string> } callback - the callback of getProtocol.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @param { AsyncCallback<string> } callback - the callback of getProtocol.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getProtocol(callback: AsyncCallback<string>): void;\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getProtocol(): Promise<string>;\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @param { AsyncCallback<Array<string>> } callback - the callback of getCipherSuite.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @param { AsyncCallback<Array<string>> } callback - the callback of getCipherSuite.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getCipherSuite(callback: AsyncCallback<Array<string>>): void;\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @returns { Promise<Array<string>> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @returns { Promise<Array<string>> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getCipherSuite(): Promise<Array<string>>;\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @param { AsyncCallback<Array<string>> } callback - the callback of getSignatureAlgorithms.@see https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @param { AsyncCallback<Array<string>> } callback - the callback of getSignatureAlgorithms.@see https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getSignatureAlgorithms(callback: AsyncCallback<Array<string>>): void;\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @returns { Promise<Array<string>> } The promise returned by the function.@see https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @returns { Promise<Array<string>> } The promise returned by the function.@see https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        getSignatureAlgorithms(): Promise<Array<string>>;\n        /**\n         * Obtains the file descriptor of the TLSSocket connection.\n         * @returns { Promise<number> } The promise returns the file descriptor of the TLSSocket connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 16\n         */\n        getSocketFd(): Promise<number>;\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @param { AsyncCallback<void> } callback - the callback of connect.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        connect(options: TLSConnectOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sets up a connection to the specified IP address and port number.\n         * Only TCP is supported.\n         * @param { TLSConnectOptions } options - Optional parameters {@link TLSConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303104 - Interrupted system call.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2303191 - Incorrect socket protocol type.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303210 - Connection timed out.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301206 - Socks5 failed to connect to the proxy server.\n         * @throws { BusinessError } 2301207 - Socks5 username or password is invalid.\n         * @throws { BusinessError } 2301208 - Socks5 failed to connect to the remote server.\n         * @throws { BusinessError } 2301209 - Socks5 failed to negotiate the authentication method.\n         * @throws { BusinessError } 2301210 - Socks5 failed to send the message.\n         * @throws { BusinessError } 2301211 - Socks5 failed to receive the message.\n         * @throws { BusinessError } 2301212 - Socks5 serialization error.\n         * @throws { BusinessError } 2301213 - Socks5 deserialization error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        connect(options: TLSConnectOptions): Promise<void>;\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string } data - Parameters for sending data {@link string}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string } data - Parameters for sending data {@link string}.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string | ArrayBuffer } data - Parameters for sending data.\n         * @param { AsyncCallback<void> } callback - the callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        send(data: string | ArrayBuffer, callback: AsyncCallback<void>): void;\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string } data - Parameters for sending data {@link string}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string } data - Parameters for sending data {@link string}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Sends data over a TLSSocket connection.\n         * @param { string | ArrayBuffer } data - Parameters for sending data.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        send(data: string | ArrayBuffer): Promise<void>;\n        /**\n         * Closes a TLSSocket connection\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Closes a TLSSocket connection\n         * @param { AsyncCallback<void> } callback - the callback of close.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(callback: AsyncCallback<void>): void;\n        /**\n         * Closes a TLSSocket connection\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Closes a TLSSocket connection\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        close(): Promise<void>;\n    }\n    /**\n     * Defines TLS security options. The CA certificate is mandatory, and other parameters are optional.\n     * @interface TLSSecureOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Defines TLS security options. The CA certificate is mandatory, and other parameters are optional.\n     * @interface TLSSecureOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TLSSecureOptions {\n        /**\n         * Certificate used to verify the identity of the server\n         * @type {string | Array<string>}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Certificate used to verify the identity of the server.\n         * @type {string | Array<string>}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        /**\n         * Certificate used to verify the identity of the server, if it is not set, use system ca.\n         * @type {?(string | Array<string>)}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        ca?: string | Array<string>;\n        /**\n         * Certificate proving the identity of the client\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Certificate proving the identity of the client\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        cert?: string;\n        /**\n         * Private key of client certificate\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Private key of client certificate\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        key?: string;\n        /**\n         * Password of the private key\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Password of the private key\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        password?: string;\n        /**\n         * TLS protocol version\n         * @type {?Protocol | Array<Protocol>}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * TLS protocol version\n         * @type {?(Protocol | Array<Protocol>)}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        protocols?: Protocol | Array<Protocol>;\n        /**\n         * default is false, use local cipher.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * default is false, use local cipher.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        useRemoteCipherPrefer?: boolean;\n        /**\n         * <P>Supported signature algorithms. This string can contain summary algorithms(SHA256,MD5,etc),Public key algorithm(RSA-PSS,ECDSA,etc),\n         * Combination of the two(For example 'RSA+SHA384') or TLS v1.3 Scheme name(For example  rsa_pss_pss_sha512)</P>\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * <P>Supported signature algorithms. This string can contain summary algorithms(SHA256,MD5,etc),Public key algorithm(RSA-PSS,ECDSA,etc),\n         * Combination of the two(For example 'RSA+SHA384') or TLS v1.3 Scheme name(For example  rsa_pss_pss_sha512)</P>\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        signatureAlgorithms?: string;\n        /**\n         * Crypto suite specification\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Crypto suite specification\n         * @type {?string}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        cipherSuite?: string;\n        /**\n         * Used to set up bidirectional authentication. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        isBidirectionalAuthentication?: boolean;\n    }\n    /**\n     * Defines TLS connection options.\n     * @interface TLSConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Defines TLS connection options.\n     * @interface TLSConnectOptions\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export interface TLSConnectOptions {\n        /**\n         * Gateway address.\n         * @type {NetAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Gateway address.\n         * @type {NetAddress}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        address: NetAddress;\n        /**\n         * Protocol http2TLS security related operations.\n         * @type {TLSSecureOptions}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Protocol http2TLS security related operations.\n         * @type {TLSSecureOptions}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        secureOptions: TLSSecureOptions;\n        /**\n         * Application layer protocol negotiation extension, such as \"spdy/1\", \"http/1.1\", \"h2\"\n         * @type {?Array<string>}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Application layer protocol negotiation extension, such as \"spdy/1\", \"http/1.1\", \"h2\"\n         * @type {?Array<string>}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        ALPNProtocols?: Array<string>;\n        /**\n         * Skip identity verification for remote servers. The default value is false.\n         * @type {?boolean}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        skipRemoteValidation?: boolean;\n        /**\n         * Set this option for the proxy feature.\n         * @type {?ProxyOptions}\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 18\n         */\n        proxy?: ProxyOptions;\n    }\n    /**\n     * Enumerates TLS protocol versions.\n     * @enum {string}\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 9\n     */\n    /**\n     * Enumerates TLS protocol versions.\n     * @enum {string}\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 10\n     */\n    export enum Protocol {\n        /**\n         * Use TLSv1.2 protocol for communication.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Use TLSv1.2 protocol for communication.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        TLSv12 = \"TLSv1.2\",\n        /**\n         * Use TLSv1.3 protocol for communication.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 9\n         */\n        /**\n         * Use TLSv1.3 protocol for communication.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 10\n         */\n        TLSv13 = \"TLSv1.3\"\n    }\n    /**\n     * Defines the connection of the TCPSocket client and server.\n     * @interface TCPSocketConnection\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    export interface TCPSocketConnection {\n        /**\n         * The id of a client connects to the TCPSocketServer.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        clientId: number;\n        /**\n         * Sends data over a TCPSocketServer connection to client.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Parameters for sending data {@link TCPSendOptions}.\n         * @param { AsyncCallback<void> } callback - The callback of send.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        send(options: TCPSendOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sends data over a TCPSocketServer connection to client.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPSendOptions } options - Parameters for sending data {@link TCPSendOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        send(options: TCPSendOptions): Promise<void>;\n        /**\n         * Closes a TCPSocket client connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<void> } callback - The callback of close.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        close(callback: AsyncCallback<void>): void;\n        /**\n         * Closes a TCPSocket client connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the peer address of a TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<NetAddress> } callback - The callback of getRemoteAddress.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteAddress(callback: AsyncCallback<NetAddress>): void;\n        /**\n         * Obtains the peer address of a TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteAddress(): Promise<NetAddress>;\n        /**\n         * Obtains the local address of a TCPSocketServer connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Listens for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'message', callback: Callback<SocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Cancels listening for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for message receiving events of the TCPSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'message', callback?: Callback<SocketMessageInfo>): void;\n        /**\n         * Listens for close events of the TCPSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for close events of the TCPSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the TCPSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TCPSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines a TCPSocket server connection.\n     * @interface TCPSocketServer\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    export interface TCPSocketServer {\n        /**\n         * Binds the IP address and port number, the port number can be specified or randomly allocated by the system.\n         * <p>Listens for a TCPSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Network address information {@link NetAddress}.\n         * @param { AsyncCallback<void> } callback - The callback of listen.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        listen(address: NetAddress, callback: AsyncCallback<void>): void;\n        /**\n         * Binds the IP address and port number, the port number can be specified or randomly allocated by the system.\n         * <p>Listens for a TCPSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @permission ohos.permission.INTERNET\n         * @param { NetAddress } address - Network address information {@link NetAddress}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        listen(address: NetAddress): Promise<void>;\n        /**\n         * Obtains the status of the TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @param { AsyncCallback<SocketStateBase> } callback - The callback of getState.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getState(callback: AsyncCallback<SocketStateBase>): void;\n        /**\n         * Obtains the status of the TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Sets other attributes of the TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Parameters of the attributes {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - The callback of setExtraOptions.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets other attributes of the TCPSocketServer connection.\n         * @permission ohos.permission.INTERNET\n         * @param { TCPExtraOptions } options - Parameters of the attributes {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions): Promise<void>;\n        /**\n         * Obtains the local address of a TCPSocketServer connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for connect events of the TCPSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<TCPSocketConnection> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'connect', callback: Callback<TCPSocketConnection>): void;\n        /**\n         * Cancels listening for connect events of the TCPSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<TCPSocketConnection> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'connect', callback?: Callback<TCPSocketConnection>): void;\n        /**\n         * Listens for error events of the TCPSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TCPSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines the connection of the TLSSocket client and server.\n     * @interface TLSSocketConnection\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    export interface TLSSocketConnection {\n        /**\n         * The id of a client connects to the TLSSocketServer.\n         * @type {number}\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        clientId: number;\n        /**\n         * Sends data over a TLSSocketServer connection to client.\n         * @param { string } data - Parameters for sending data.\n         * @param { AsyncCallback<void> } callback - The callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Sends data over a TLSSocketServer connection to client.\n         * @param { string | ArrayBuffer } data - Parameters for sending data.\n         * @param { AsyncCallback<void> } callback - The callback of send.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        send(data: string | ArrayBuffer, callback: AsyncCallback<void>): void;\n        /**\n         * Sends data over a TLSSocketServer connection to client.\n         * @param { string } data - Parameters for sending data.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Sends data over a TLSSocketServer connection to client.\n         * @param { string | ArrayBuffer } data - Parameters for sending data.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        send(data: string | ArrayBuffer): Promise<void>;\n        /**\n         * Closes a TLSSocket client connection.\n         * @param { AsyncCallback<void> } callback - The callback of close.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        close(callback: AsyncCallback<void>): void;\n        /**\n         * Closes a TLSSocket client connection.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        close(): Promise<void>;\n        /**\n         * Obtains the peer address of a TLSSocketServer connection.\n         * @param { AsyncCallback<NetAddress> } callback - The callback of getRemoteAddress.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteAddress(callback: AsyncCallback<NetAddress>): void;\n        /**\n         * Obtains the peer address of a TLSSocketServer connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteAddress(): Promise<NetAddress>;\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - The callback of getRemoteCertificate.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteCertificate(callback: AsyncCallback<X509CertRawData>): void;\n        /**\n         * <p>Returns an object representing the peer certificate. If the peer does not provide a certificate,\n         * an empty object will be returned. If the socket is destroyed, null is returned.</p>\n         * It only contains the peer's certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getRemoteCertificate(): Promise<X509CertRawData>;\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @param { AsyncCallback<Array<string>> } callback - The callback of getCipherSuite.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getCipherSuite(callback: AsyncCallback<Array<string>>): void;\n        /**\n         * Returns a list containing the negotiated cipher suite information.\n         * For example:{\"TLS_RSA_WITH_AES_128_CBC_SHA256\", \"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256\"}\n         * @returns { Promise<Array<string>> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getCipherSuite(): Promise<Array<string>>;\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @param { AsyncCallback<Array<string>> } callback - The callback of getSignatureAlgorithms.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getSignatureAlgorithms(callback: AsyncCallback<Array<string>>): void;\n        /**\n         * <p>The list of signature algorithms shared between the server and the client,\n         * in descending order of priority.</p>\n         * @returns { Promise<Array<string>> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getSignatureAlgorithms(): Promise<Array<string>>;\n        /**\n         * Obtains the local address of a TLSSocketServer connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Listens for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Listens for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        on(type: 'message', callback: Callback<SocketMessageInfo>): void;\n        /**\n         * Cancels listening for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<{ message: ArrayBuffer, remoteInfo: SocketRemoteInfo }> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        /**\n         * Cancels listening for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 11\n         */\n        /**\n         * Cancels listening for message receiving events of the TLSSocketConnection.\n         * @param { 'message' } type - Indicates Event name.\n         * @param { Callback<SocketMessageInfo> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 12\n         */\n        off(type: 'message', callback?: Callback<SocketMessageInfo>): void;\n        /**\n         * Listens for close events of the TLSSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'close', callback: Callback<void>): void;\n        /**\n         * Cancels listening for close events of the TLSSocketConnection.\n         * @param { 'close' } type - Indicates Event name.\n         * @param { Callback<void> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'close', callback?: Callback<void>): void;\n        /**\n         * Listens for error events of the TLSSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TLSSocketConnection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n    /**\n     * Defines the socket connection information.\n     * @interface SocketMessageInfo\n     * @syscap SystemCapability.Communication.NetStack\n     * @crossplatform\n     * @since 11\n     */\n    export interface SocketMessageInfo {\n        /**\n         * Receive the message event.\n         * @type { ArrayBuffer }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        message: ArrayBuffer;\n        /**\n         * Socket connection information.\n         * @type { SocketRemoteInfo }\n         * @syscap SystemCapability.Communication.NetStack\n         * @crossplatform\n         * @since 11\n         */\n        remoteInfo: SocketRemoteInfo;\n    }\n    /**\n     * Defines a TLSSocketServer server connection.\n     * @interface TLSSocketServer\n     * @syscap SystemCapability.Communication.NetStack\n     * @since 10\n     */\n    export interface TLSSocketServer {\n        /**\n         * Binds the IP address and port number, the port number can be specified or randomly allocated by the system.\n         * <p>Listens for a TCPSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @permission ohos.permission.INTERNET\n         * @param { TLSConnectOptions } options - TLS connection options {@link TLSConnectOptions}.\n         * @param { AsyncCallback<void> } callback - The callback of listen.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        listen(options: TLSConnectOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Binds the IP address and port number, the port number can be specified or randomly allocated by the system.\n         * <p>Listens for a TCPSocket connection to be made to this socket and accepts it. This interface uses multiple threads\n         * for accept processing and uses poll multiplex to process client connections.</p>\n         * @permission ohos.permission.INTERNET\n         * @param { TLSConnectOptions } options - TLS connection options {@link TLSConnectOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 201 - Permission denied.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2303109 - Bad file number.\n         * @throws { BusinessError } 2303111 - Resource temporarily unavailable. Try again.\n         * @throws { BusinessError } 2303198 - Address already in use.\n         * @throws { BusinessError } 2303199 - Cannot assign requested address.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303502 - An error occurred when reading data on the TLS socket.\n         * @throws { BusinessError } 2303503 - An error occurred when writing data on the TLS socket.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2303506 - Failed to close the TLS connection.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        listen(options: TLSConnectOptions): Promise<void>;\n        /**\n         * Obtains the status of the TLSSocketServer connection.\n         * @param { AsyncCallback<SocketStateBase> } callback - The callback of getState.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getState(callback: AsyncCallback<SocketStateBase>): void;\n        /**\n         * Obtains the status of the TLSSocketServer connection.\n         * @returns { Promise<SocketStateBase> } The promise returned by the function.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getState(): Promise<SocketStateBase>;\n        /**\n         * Sets other attributes of the TLSSocketServer connection.\n         * @param { TCPExtraOptions } options - Parameters of the attributes {@link TCPExtraOptions}.\n         * @param { AsyncCallback<void> } callback - The callback of setExtraOptions.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;\n        /**\n         * Sets other attributes of the TLSSocketServer connection.\n         * @param { TCPExtraOptions } options - Parameters of the attributes {@link TCPExtraOptions}.\n         * @returns { Promise<void> } The promise returned by the function.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        setExtraOptions(options: TCPExtraOptions): Promise<void>;\n        /**\n         * Returns an object representing a local certificate.\n         * @param { AsyncCallback<X509CertRawData> } callback - The callback of getCertificate.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getCertificate(callback: AsyncCallback<X509CertRawData>): void;\n        /**\n         * Returns an object representing a local certificate.\n         * @returns { Promise<X509CertRawData> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303504 - An error occurred when verifying the X.509 certificate.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getCertificate(): Promise<X509CertRawData>;\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @param { AsyncCallback<string> } callback - The callback of getProtocol.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getProtocol(callback: AsyncCallback<string>): void;\n        /**\n         * Returns a string containing the negotiated SSL/TLS protocol version of the current connection.\n         * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned.\n         * Server sockets or disconnected client sockets will return a value of null.\n         * @returns { Promise<string> } The promise returned by the function.\n         * @throws { BusinessError } 2303501 - SSL is null.\n         * @throws { BusinessError } 2303505 - An error occurred in the TLS system call.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        getProtocol(): Promise<string>;\n        /**\n         * Obtains the local address of the TLSSocketServer connection.\n         * @returns { Promise<NetAddress> } The promise returned by the function.\n         * @throws { BusinessError } 2300002 - System internal error.\n         * @throws { BusinessError } 2301009 - Bad file descriptor.\n         * @throws { BusinessError } 2303188 - Socket operation on non-socket.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 12\n         */\n        getLocalAddress(): Promise<NetAddress>;\n        /**\n         * Listens for connect events of the TLSSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<TLSSocketConnection> } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'connect', callback: Callback<TLSSocketConnection>): void;\n        /**\n         * Cancels listening for connect events of the TLSSocketServer connection.\n         * @param { 'connect' } type - Indicates Event name.\n         * @param { Callback<TLSSocketConnection> } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'connect', callback?: Callback<TLSSocketConnection>): void;\n        /**\n         * Listens for error events of the TLSSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of on.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        on(type: 'error', callback: ErrorCallback): void;\n        /**\n         * Cancels listening for error events of the TLSSocketServer connection.\n         * @param { 'error' } type - Indicates Event name.\n         * @param { ErrorCallback } callback - The callback of off.\n         * @throws { BusinessError } 401 - Parameter error.\n         * @syscap SystemCapability.Communication.NetStack\n         * @since 10\n         */\n        off(type: 'error', callback?: ErrorCallback): void;\n    }\n}\nexport default socket;\n",
}
export default FILE;